package demo07;

public class Student implements Comparable<Student>{
    String name;
    int age;
    int score;

    public Student(String name, int age,int score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }
    public String toString(){
        return "Student{"+"name = '" +name +'\'' +", age = "+age + ", score = "+score+'}';
    }
    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }
}
